Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FZ-112 meeting type/category dictionary, some fixes to old migrations #161

Merged
merged 3 commits into from
Nov 3, 2023

Conversation

mblajek
Copy link
Owner

@mblajek mblajek commented Nov 2, 2023

zaproponowane przeze mnie ostatnio insertOrIgnore ignoruje wszystkie możliwe błędy, upsert robi bardziej to co potrzeba

zmieniłem daty w starych migracjach gdzie mi się rok pomylił (2022 :D), a zahardkodowałem

no i 2 nowe słowniki, tylko że typ i kategoria nie są połączone ze sobą, bedą połączone przez attributes

@TPReal TPReal force-pushed the develop branch 2 times, most recently from d2a3fc6 to ccecccb Compare November 2, 2023 16:47
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Czy tu z jakiegoś konkretnego powodu zostawiłeś insert i insertOrIgnore? Jeśli nie to pewnie też warto zmienić.

{
$this->down();

$date = '2023-11-02 00:00:00';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W sumie tej daty nie musimy hardkodować, można użyć obecnego czasu.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

właśnie sam nie wiem, ten wiersz w bazie jakby pochodzi z czasu kiedy tworzyłem migrację, a nie z czasu kiedy została wykonana

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Z drugiej strony jak się setupuje bazę dla klienta, to czemu mają w niej istnieć wiersze "stworzone" przed datą tego setupu. Ale nie będę się kłócił - tylko wtedy pewni warto poprawić w mojej ostatniej migracji, bo tam użyłem now.

*/
public function up(): void
{
$this->down();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Właściwie z upsertem to jest zbędne, chyba że uznajesz że będą jakieś customowe pozycje już w bazie, wtedy down je wyczyści (no ale z drugiej strony ich nie oddtworzymy, więc pewnie nie powinno się to wykonać na już żyjącej bazie tak czy siak).

@mblajek mblajek merged commit 05c2a2f into develop Nov 3, 2023
1 check passed
@TPReal TPReal deleted the FZ-112 branch November 6, 2023 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants